#!/usr/bin/perl -w
use v5.10;

chomp(@words = <STDIN>);

foreach $word (@words) {
    $count{$word} += 1;
}

foreach $word (sort keys %count) {
    say "$word : $count{$word} times."
}
